/** 
 * Copyright 2010 Daniel Guermeur and Amy Unruh
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 *   See http://connectrapp.appspot.com/ for a demo, and links to more information 
 *   about this app and the book that it accompanies.
 */
package org.noranj.formak.client.event;

import org.noranj.formak.shared.dto.SystemUserDTO;

import com.google.gwt.event.shared.GwtEvent;

//TODO SA I added this one but not sure how exactly it will be used.
/**
 * 
 * @version 0.3.2012MAR01
 * @since 0.3.2012MAR01
 * @change
 *  BA:12-MAR-01 I replaced UserAccountDTO with SystemUserDTO
 */
public class LoginEvent extends GwtEvent<LoginEventHandler> {
  
  public static Type<LoginEventHandler> TYPE = new Type<LoginEventHandler>();
  
  private final SystemUserDTO user;

  public LoginEvent(SystemUserDTO user) {
    this.user = user;
  }

  public SystemUserDTO getUser() {
    return user;
  }

  @Override public Type<LoginEventHandler> getAssociatedType() {
    return TYPE;
  }

  @Override protected void dispatch(LoginEventHandler handler) {
    handler.onLogin(this);
  }
}
